import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<SetPasswordByOldState> buildReducer() {
  return asReducer(
    <Object, Reducer<SetPasswordByOldState>>{
      SetPasswordByOldAction.updateLoading: _onLoadingAction,
    },
  );
}

SetPasswordByOldState _onLoadingAction(SetPasswordByOldState state, Action action) {
  final SetPasswordByOldState newState = state.clone();
  newState.isLoading = action.payload;
  return newState;
}